home *** CD-ROM | disk | FTP | other *** search
/ L' Effet Pommier 3 / L'Effet Pommier - Volume 03.iso / Programmation / Alpha ƒ / Tcl / SystemCode / toolboxAssist.tcl < prev    next >
Text File  |  1995-03-07  |  2KB  |  78 lines

  1. #================================================================================
  2. # QuickView¬ Toolbox Assistant Help
  3. #================================================================================
  4.  
  5. proc toolboxRefMenu {} {}
  6.  
  7. menu -m -n $toolboxRefMenu -p toolboxProc {
  8.     "Goto Reference"
  9.     "(-"
  10.     "Display Trap Template"
  11.     "Insert Trap Template"
  12.     "/L<O<ULookup Trap"
  13. }
  14.  
  15.  
  16. proc toolboxProc {menu item} {
  17.     switch $item {
  18.         "Goto Reference"        { gotoTBReference }
  19.         "Display Trap Template"    { displayTBTrapTemplate }
  20.         "Insert Trap Template"     { insertTBTrapTemplate }
  21.         "Lookup Trap"            { lookupTBTrap }
  22.     }
  23. }
  24.  
  25.  
  26. set lastTrap {}
  27.  
  28. proc insertTBTrapTemplate {} {
  29.     global lastTrap
  30.  
  31.     if {![string length [checkRunning QuickView¬ ALTV tassPath]]} return
  32.     set text [getSelect]
  33.     if {![string length $text]} {
  34.         if {[catch {prompt "Trap name:" $lastTrap} text]} return
  35.     } else {
  36.         deleteText [getPos] [selEnd]
  37.     }
  38.     set lastTrap $text
  39.     set res [AEBuild -r {'ALTV'} DanR {TMPL} "----" "╥$text╙"]
  40.     regexp {╥.*╙} $res one
  41.     insertText [string trim $one {╥╙}]
  42. }
  43.  
  44. proc displayTBTrapTemplate {} {
  45.     global lastTrap
  46.  
  47.     if {![string length [checkRunning QuickView¬ ALTV tassPath]]} return
  48.     set text {}
  49.     catch {set text [getSelect]}
  50.     if {![string length $text]} {
  51.         if {[catch {prompt "Trap name:" $lastTrap} text]} return
  52.     }
  53.     set lastTrap $text
  54.  
  55.     set res [AEBuild -r {'ALTV'} DanR {TMPL} "----" "╥$text╙"]
  56.     regexp {╥.*╙} $res one
  57.     alertnote [string trim $one {╥╙}]
  58. }
  59.  
  60. proc lookupTBTrap {} {
  61.     global lastTrap
  62.  
  63.     if {![string length [checkRunning QuickView¬ ALTV tassPath]]} return
  64.     set text {}
  65.     catch {set text [getSelect]}
  66.     if {![string length $text]} {
  67.         if {[catch {prompt "Trap name:" $lastTrap} text]} return
  68.     }
  69.     set lastTrap $text
  70.     AEBuild {'ALTV'} DanR {REF } "----" "╥$text╙"
  71. }
  72.  
  73. proc gotoTBReference {} {
  74.     catch {switchTo [checkRunning QuickView¬ ALTV tassPath]}
  75. }
  76.  
  77.  
  78.